<template>
	<view>
		<view class="risk-tab-top">
			<view class="risk-tab-cont" @click="tabChange(index)" v-for="(item,index) in tabList " :class="[activeIndex == index?'risk-active':'']"
			 :key="index">{{item}}</view>
			<view class="risk-active-line" :class="{'risk-active-line-f':activeIndex == 0,'risk-active-line-r':activeIndex==1,'risk-active-line-s':activeIndex==2}"></view>
		</view>
		<view class="risk-cont">
			<view v-show="activeIndex == 0">
				<!-- 设计师介绍 -->
				<introduction></introduction>
			</view>
			<view v-show="activeIndex == 1">22222222</view>
			<view v-show="activeIndex == 2">333333333</view>
		</view>
	</view>
</template>

<script>
	import introduction from "./components/introduction.vue"
	export default {
		components: {
			introduction
		},
		data() {
			return {
				tabList: ['品牌介绍', '服务特色', '环境设施'],
				contList: ['11111111', '2222222222', '3333333'],
				activeIndex: 0,
			}
		},
		methods: {
			tabChange(val) {
				this.activeIndex = val;
				console.log(val);
			},
		}
	}
</script>

<style lang="scss">
	.risk-tab-top {
		
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #626262;
		display: flex;
		padding: 20rpx 256rpx 20rpx 20rpx;
		position: relative;
		justify-content: space-between;
		border-bottom: 1rpx solid #F1F1F1;

		.risk-tab-cont {
			padding: 0 10rpx;
			font-size: 28rpx;

			font-family: PingFang;
			font-weight: 500;
			
		}

		.risk-active {
			color: #212121;
		}

		.risk-active-line {
			width: 30px;
			height: 3px;
			background: rgba(0, 255, 255, 1);
			position: absolute;
			top: 35px;
			left: 36px;
			transition: all 0.3s ease;
		}

		.risk-active-line-f {
			left: 10%;
		}

		.risk-active-line-r {
			left: 32%;
		}

		.risk-active-line-s {
			left: 53%;
		}
	}
</style>
